<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<style>
    #main {width:900px;

        border: #0000ff solid 1px;
        margin:auto;}
    .d1{
        margin-left: 150px;
        margin-bottom: 50px;
        margin-top: 50px;
    }
</style>
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <link rel="stylesheet" href="bootstrap-3.3.7-dist/css/bootstrap.min.css" >
    <title>Title</title>
</head>
<body>
<div >
    <div>
        <h2>登入成功</h2>
        <p>用户名:</p>
        <p></p>
        <table class="table table-striped table-hover table-bordered  ">
            <tr>
                <th>班级</th>
                <th>年级</th>
                <th>班主任</th>
                <th>口号</th>
                <th>人数</th>
                <th>操作</th>
                <th>操作</th>

            </tr>
           <c:set scope="request" var="count" value="0"></c:set>
            <c:forEach items="${requestScope.classList}" var="list" >
                <c:if test="${count % 3 == 1}">
                    <tr class="active">
                        <th>${list.className}</th>
                        <th>${list.grade}</th>
                        <th>${list.chairman}</th>
                        <th>${list.slogan}</th>
                        <th>${list.count}</th>
                        <th><a href="${pageContext.request.contextPath}/ClassMessage?method=updateFind&cid=${list.cid}&className=${list.className}&grade=${list.grade}&chairman=${list.chairman}&slogan=${list.slogan}&count=${list.count}">修改</a></th>
                        <th><a href="${pageContext.request.contextPath}/ClassMessage?method=delete&id=${list.cid}">删除</a></th>
                    </tr>
                </c:if>
                <c:if test="${count % 3 ==2}">
                    <tr class="warning">
                        <th>${list.className}</th>
                        <th>${list.grade}</th>
                        <th>${list.chairman}</th>
                        <th>${list.slogan}</th>
                        <th>${list.count}</th>
                        <th><a href="${pageContext.request.contextPath}/ClassMessage?method=updateFind&cid=${list.cid}&className=${list.className}&grade=${list.grade}&chairman=${list.chairman}&slogan=${list.slogan}&count=${list.count}">修改</a></th>
                        <th><a href="${pageContext.request.contextPath}/ClassMessage?method=delete&id=${list.cid}">删除</a></th>
                    </tr>
                </c:if>
                <c:if test="${count % 3 ==0 }">
                    <tr class="success">
                        <th>${list.className}</th>
                        <th>${list.grade}</th>
                        <th>${list.chairman}</th>
                        <th>${list.slogan}</th>
                        <th>${list.count}</th>
                        <th><a href="${pageContext.request.contextPath}/ClassMessage?method=updateFind&cid=${list.cid}&className=${list.className}&grade=${list.grade}&chairman=${list.chairman}&slogan=${list.slogan}&count=${list.count}">修改</a></th>
                        <th><a href="${pageContext.request.contextPath}/ClassMessage?method=delete&id=${list.cid}">删除</a></th>
                    </tr>
                </c:if>
                <c:set scope="request" var="count" value="${count=count+1}"></c:set>

            </c:forEach>
        </table>
        <a href="addclassMessage.jsp"><p style="color: #ff0000 ;" >继续增加学生信息</p></a>


    </div>
</div>
</body>
</html>
